package com.advert.boot;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.ansi.AnsiColor;
import org.springframework.boot.ansi.AnsiOutput;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;

/**
 * 应用启动类
 *
 * @author Ray.Hao
 * @since 0.0.1
 */
@Slf4j
@SpringBootApplication
@ConfigurationPropertiesScan // 开启配置属性绑定
public class AdvertBootApplication implements CommandLineRunner {

    public static void main(String[] args) {
        SpringApplication.run(AdvertBootApplication.class, args);
    }

    @Override
    public void run(String... strings) {
        log.info(AnsiOutput.toString(AnsiColor.GREEN, "----------------------平台启动成功--------------------------" +
                        "\n" +
                        "                           _..._          _..._                                          \n" +
                        "                        .-'_..._''.    .-'_..._''.                                       \n" +
                        "                      .' .'      '.\\ .' .'      '.\\     __.....__                        \n" +
                        "                     / .'           / .'            .-''         '.                      \n" +
                        "                    . '            . '             /     .-''\"'-.  `.                    \n" +
                        "                    | |            | |            /     /________\\   \\                   \n" +
                        "       _     _    _ | |            | |            |                  |    _         _    \n" +
                        "     .' |   | '  / |. '            . '            \\    .-------------'  .' |      .' |   \n" +
                        "    .   | /.' | .' | \\ '.          .\\ '.          .\\    '-.____...---. .   | /   .   | / \n" +
                        "  .'.'| |///  | /  |  '. `._____.-'/ '. `._____.-'/ `.             .'.'.'| |// .'.'| |// \n" +
                        ".'.'.-'  /|   `'.  |    `-.______ /    `-.______ /    `''-...... -'.'.'.-'  /.'.'.-'  /  \n" +
                        ".'   \\_.' '   .'|  '/            `              `                  .'   \\_.' .'   \\_.'   \n" +
                        "           `-'  `--'                                                                     \n"
                )
        );
    }
}
